#!/bin/bash

#创建分支：git fork
#检到本地：git clone
#查看状态：git remote -v
#添加上游：git remote add upstream origin-url

#更新上游：git fetch upstream
#检出自己的fork：git checkout master
#合并上游更新：git merge upstream/master
#更新自己的库：git push

echo "2-merge esp_mqtt."
cd esp_mqtt
git remote add upstream https://github.com/tuanpmt/esp_mqtt.git
git fetch upstream
git merge upstream/master
cd ..


echo "3-merge esp_mqtt_oled."
cd esp_mqtt_oled
git remote add upstream https://github.com/nathanchantrell/esp_mqtt_oled.git
git fetch upstream
git merge upstream/master
cd ..

echo "4-merge esp_iot_rtos_sdk."
cd espressif/esp_iot_rtos_sdk
git remote add upstream https://github.com/espressif/esp_iot_rtos_sdk.git
git fetch upstream
git merge upstream/master
cd ../../

echo "4B-merge esp_iot_rtos_sdk_lib."
cd espressif/esp_iot_rtos_sdk_lib
git remote add upstream https://github.com/espressif/esp_iot_rtos_sdk_lib.git
git fetch upstream
git merge upstream/master
cd ../../

echo "5-merge esp8266_at."
cd espressif/esp8266_at
git remote add upstream https://github.com/espressif/esp8266_at.git
git fetch upstream
git merge upstream/master
cd ../../

echo "6-merge micropython for esp8266."
cd micropython
git remote add upstream https://github.com/micropython/micropython.git
git fetch upstream
git merge upstream/master

cd ..

echo "7-merge nodemcu."
cd nodemcu/nodemcu-firmware
git remote add upstream https://github.com/nodemcu/nodemcu-firmware.git
git fetch upstream
git merge upstream/master

cd ../../

echo "8-merge nodelua."
cd nodelua
git remote add upstream https://github.com/haroldmars/nodelua.git
git fetch upstream
git merge upstream/master
cd ..

echo "9-merge frankenstein."
cd esp8266-frankenstein
git remote add upstream https://github.com/nekromant/esp8266-frankenstein.git
git fetch upstream
git merge upstream/master
cd ..

